package com.education.user.service;

import com.education.user.mapper.ClassMapper;
import com.education.user.pojo.Classes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassService {

    @Autowired
    private ClassMapper classMapper;

    //主键搜索
    public Classes selectById(Integer id){
        return classMapper.selectByPrimaryKey(id);
    }

    //条件查询集合
    public List<Classes> select(Classes classes){
        return classMapper.select(classes);
    }

    //添加数据
    public int insert(Classes classes){
        return classMapper.insertSelective(classes);
    }

    //修改
    public int update(Classes classes){
        return classMapper.updateByPrimaryKeySelective(classes);
    }

    //批量删除
    public int delete(int id){
        return classMapper.deleteByPrimaryKey(id);
    }
}
